def primeSieve(n):
    #n=input("What number?")
        p=2
        total=[True]*n
        total[0]=False
        total[1]=False
        i=0
        while i<=n:
            
            if i<len(total) and total[i]==True:
                for j in range(i*i,n,i):
                   # print j
                    total[j]=False
            i=i+1
        #print "[",
        c=0
        prime=[]
        while c<n:
            if total[c]==True:
              #  print c,
                prime.append(c)
            c+=1
        #prime is an array of all primes less than n
        return prime
